
<div class="bjui-pageHeader">
	<form id="pagerForm" data-toggle="ajaxsearch"
		action="${base}/admin/questions">
		<div class="bjui-searchBar">
		 &nbsp; <label>题干:</label> <input value="${(vo.title)!}"
				name="title" /> &nbsp; 
				 &nbsp; <label>id:</label> <input value="${(vo.idLike)!}"
				name="idLike" /> &nbsp; 
				
					 &nbsp; <label>题型:</label><select data-rule="required"
						name=type data-toggle="selectpicker" data-width=150>
							<option value="-1">全部</option>
							</option> <#list questionsType?keys as i>
							<option value="${i}"}  <#if
								vo.type??&&vo.type==i?number> selected</#if>>${questionsType[i]}</option>
							</#list>
					</select> &nbsp; 
			
			<button type="button" class="showMoreSearch" data-toggle="moresearch"
				data-name="custom">
				<i class="fa fa-angle-double-down"></i>
			</button>
			&nbsp;
			<button type="submit" class="btn-default" data-icon="search">查询</button>
			&nbsp; <a class="btn btn-orange" href="javascript:;"
				data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">清除</a>
			&nbsp;
			<div class="pull-right">
				<button type="button" data-icon="sign-in" class="btn-red"
					data-url="${base}/admin/questionsDialog" data-toggle="dialog"
					data-id='importDialog1' data-mask='true'>导入</button>
				&nbsp;
				<button type="button" class="btn-blue"
					data-url="${base}/admin/questionsAdd?show=1" data-toggle="navtab"
					data-icon="plus" data-fresh=true data-id="questionsAdd"
					data-reload-warn="本页已有打开的内容，确定将刷新本页内容，是否继续？" data-title="新增"}>新增</button>
				&nbsp;
				<button type=" button" class="btn-blue"
					data-url="${base}/admin/questionsDel" data-toggle="doajaxchecked"
					data-confirm-msg="确定要删除选中项吗？" data-icon="remove"
					data-idname="delids" data-group="ids">删除选中行</button>
				&nbsp;
			</div>
		</div>
		<div class="bjui-moreSearch"><!-- data-pattern="yyyy-MM-dd HH:mm:ss" --> 
			<label>&nbsp;生成时间起:</label> <input type="text"
				data-toggle="datepicker" value="${(vo.createTime1?date)!}"  
				name="createTime1"> <label>&nbsp;生成时间止:</label> <input
				type="text" data-toggle="datepicker"   
				value="${(vo.createTime2?date)!}" name="createTime2">
		</div>
		<input type="hidden" id="hiddenId" name="questionsTypeId"
			value="${(vo.questionsTypeId)!}" />
	</form>
</div>
<div class="bjui-pageContent tableContent mylist">
	<table data-toggle="tablefixed" data-width="100%" data-nowrap="true"
		class="table  table-striped table-condensed"
		data-selected-multi="false">
		<thead>
			<tr>
				<th width="100" data-order-field="id">id</th>
				<th width="100" data-order-field="year">来源</th>
				<th width="100" data-order-field="type">题型</th>
				<!-- 	<th width="100" data-order-field="type2">类型</th> -->
				<th width="100" data-order-field="title">题干</th>
				<th width="100" data-order-field="content">选项</th>
				<th width="100" data-order-field="answer">答案</th>
				<th width="100" data-order-field="answers">答案描述</th>
				<th width="100" data-order-field="analysis">解析</th>
				<th width="100" data-order-field="fraction">分数</th>
				<!-- 	<th width="100"data-order-field="make_time">做的时间</th>
				<th width="100"data-order-field="yes_num">做对总人数</th>
				<th width="100"data-order-field="error_num">做错总人数</th>
				<th width="100"data-order-field="make_num">做的总人数</th>
				<th width="100"data-order-field="weight">权重 越大越排前面</th> -->
				<th width="100" data-order-field="questions_type_id">父id</th>
				<th width="100" data-order-field="image">图片</th>
							<th width="100" data-order-field="image"> 公式</th>
				<th width="100" data-order-field="create_time">创建时间</th>
				<th width="26"><input type="checkbox" class="checkboxCtrl"
					data-group="ids" data-toggle="icheck"></th>
				<th width="100">操作</th>
			</tr>
		</thead>
		<tbody>
			<#list list as i>
			<tr data-id="${i.id}">

				<td>${(i.id)!}</td>
				<td>${(i.year)!}</td>

				<td>${questionsType[(i.type)!?string]}</td>

				<td>${(i.title)!}</td>
				<td>${(i.content)!}</td>

				<td>${(i.answer)!}</td>
				<td>${(i.answers)!}</td>
				<td>${(i.analysis)!}</td>
				<td>${(i.fraction)!}</td>
				<!-- 	<td>${(i.makeTime)!}</td>
				<td>${(i.yesNum)!}</td>
				<td>${(i.errorNum)!}</td>
				<td>${(i.makeNum)!}</td>
				<td>${(i.weight)!}</td> -->
				<td>${Chapter[(i.questionsTypeId)!?string]!}</td>
				<td>编辑查看</td>
		<td>编辑查看</td>
				<td>${((i.createTime)!?datetime)!}</td>

				<td><input type="checkbox" name="ids" data-toggle="icheck"
					value="${i.id}"></td>
				<td><a href="${base}/admin/questionsEdit?id=${i.id}&show=1"
					class="btn btn-green" data-toggle="navtab" data-fresh=true
					data-icon="edit" data-id="questionsEdit"
					data-reload-warn="本页已有打开的内容，确定将刷新本页内容，是否继续？"
					data-title="编辑-${i.name!}">编辑</a></td>
			</tr>
			</#list>
		</tbody>
	</table>
</div>
<div class="bjui-pageFooter">
	<div class="pages">
		<span>每页&nbsp;</span>
		<div class="selectPagesize">
			<select data-toggle="selectpicker"
				data-toggle-change="changepagesize">
				<option value="10"<#if vo.pageSize==10> selected</#if>>10</option>
				<option value="20"<#if vo.pageSize==20> selected</#if>>20</option>
				<option value="30"<#if vo.pageSize==30> selected</#if>>30</option>
				<option value="40"<#if vo.pageSize==40> selected</#if>>40</option>
			</select>
		</div>
		<span>,&nbsp;共 ${vo.totalCount!} 条, 第 ${vo.pageNum!} 页</span>
	</div>
	<div class="pagination-box" data-toggle="pagination"
		data-total="${vo.totalCount!}" data-page-size="${vo.pageSize!}"
		data-page-current="${vo.pageNum!}"></div>
</div>

 <script>
  $(function() {
 
    var names = JSON.parse('${listType}'.replace("|['chr(1)-chr(31)' ]+|",''));
 	
    var accentMap = {
      "á": "a",
      "ö": "o"
    };
 
    $( "#chapter_select" ).autocomplete({
      source: function( request, response ) {
        var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
        response( $.grep( names, function( value ) {
       
          return matcher.test( value.lable ) ;
        }) );
      }
    });
  });
  </script>
<script type="text/javascript">

	var index=0;
	$(function(){
	
 	$("#section_id").click(function(){
 	
 	$(".dropdown-menu.inner.selectpicker").children().each(function(i,n){
 	$(n).unbind("click");
      $(n).click(function(){
    	    if($(this).attr("data-original-index")!=-1){
  		$("#hiddenId").val($("#sectionId").children().eq($(this).attr("data-original-index")).attr("value"));
  		
      }
	});
 	});
	});
	
 	$("#chapter_id").click(function(){
 	
 	$(".dropdown-menu.inner.selectpicker").children().each(function(i,n){
 	$(n).unbind("click");
      $(n).click(function(){
    	    if($(this).attr("data-original-index")!=-1){
  		$("#hiddenId").val($("#chapterId").children().eq($(this).attr("data-original-index")).attr("value"));
  		
      }
	});
 	});
	});
	
		
 	$("#subdivisionIPoint_id").click(function(){
 	
 	$(".dropdown-menu.inner.selectpicker").children().each(function(i,n){
 	$(n).unbind("click");
      $(n).click(function(){
    	    if($(this).attr("data-original-index")!=-1){
  		$("#hiddenId").val($("#subdivisionIPointId").children().eq($(this).attr("data-original-index")).attr("value"));
  		
      }
	});
 	});
	});
		
 	$("#spot_id").click(function(){
 	
 	$(".dropdown-menu.inner.selectpicker").children().each(function(i,n){
 	$(n).unbind("click");
      $(n).click(function(){
      if($(this).attr("data-original-index")!=-1){
  		$("#hiddenId").val($("#spotId").children().eq($(this).attr("data-original-index")).attr("value"));
      }
    	
	});
 	});
	});
	
	});
	
	
</script>